package example.Test001;

import java.nio.ByteBuffer;

import static example.ByteBufferUtil.debugAll;


/**
 * ClassName: Test01
 * Package: org.example.Test001
 * Description:
 *
 * @Author BCXJ
 * @Create 2025/9/18 07:58
 * @Version 1.0
 * @Since 1.0
 */
public class Test01 {
    public static void main(String[] args) {
        ByteBuffer buffer = ByteBuffer.allocate(10);
        buffer.put((byte)0x61);
        debugAll(buffer);
        buffer.put(new byte[]{(byte)0x62, (byte)0x63, (byte)0x64, (byte)0x65});
        debugAll(buffer);
        System.out.println(buffer.get());
        debugAll(buffer);
        buffer.flip();
        System.out.println(buffer.get());
        debugAll(buffer);
        buffer.compact();
        debugAll(buffer);
        System.out.println(buffer.get());
    }
}
